<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h2>标题</h2>
    <p>我是内容</p>
    <div id="app">
        <h3>{{message}}</h3>
        <button @click="change">改变message</button>
    </div>
    <!-- cdn地址 -->
    <script src="https://unpkg.com/vue@next"></script>
    <script>
        // 使用vue
        const app = Vue.createApp({
            // template: `<h2>Hello word</h2><span>呵呵呵</span>`
            // ,
            //一、data属性 option api
            data: function () {
                return {
                    message: "学习vue"
                }
            },
            //option api
            methods: {
                change: function () {
                    this.message = "记得坚持"
                    console.log("change");
                }
            }
        })
        // 挂载
        app.mount("#app")
    </script>
</body>

</html>